<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>意见反馈</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link th:href="@{/loanStatic/feedback/css/style.css}" rel="stylesheet" type="text/css"/>
        <script th:src="@{/loanStatic/feedback/js/jquery.js}"></script>
        <link th:href="@{/loanStatic/tip/mdialog.css}" rel="stylesheet" type="text/css">
        <script th:src="@{/loanStatic/tip/mdialog.js}"></script>
    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed">
                <a href="javascript:;" class="aui-navBar-item" onclick="backBtn();">
                    <i class="icon-return" style="width: 20px;height: 20px;display: block;border: none;float: left;background-size: 20px;background-repeat: no-repeat"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title">意见反馈</span>
                </div>
                <a href="javascript:;" class="aui-navBar-item">
                    <i class="icon icon-sys"></i>
                </a>
            </header>
            <section class="aui-scrollView">
                <div class="aui-view-box">
                    <div class="aui-view-box-item">
                        <h2>您的问题或建议:</h2>
                        <textarea id="content" name="content" placeholder="输入个人意见反馈,字数在200字以内"></textarea>
                    </div>
                    <div class="aui-view-box-item">
                        <h2>您的联系方式:</h2>
                        <input type="text" id="remark1"  placeholder="输入电话号码">
                        <input type="text" id="remark2" placeholder="输入电子邮箱">
                    </div>
                    <div class="aui-view-box-item">
                        <p>留下您的联系方式,以便我们了解问题后及时反馈和结果，紧急问题请联系客服。</p>
                    </div>
                    <div class="aui-btn-submit">
                        <button onclick="feedbackSubmit()">提交建议</button>
                    </div>
                </div>
            </section>
            <footer class="aui-footer aui-footer-fixed">
                <p>
                    <span>
                        	遇到问题了？ <!-- 点击 <em>在线客服</em> -->请联系客服
                    </span>
                </p>
            </footer>
        </section>
        <script>
        
        function backBtn(){
        	window.location.href='/moblie/userCenterFrom';
        }
        
        function feedbackSubmit(){
        	var content=$("#content").val();
        	var remark1=$("#remark1").val();
        	var remark2=$("#remark2").val();
        	if(content==null || content==""){
        		new TipBox({type:'tip',str:'建议内容不能为空',clickDomCancel:true,setTime:1500,hasBtn:false}); 
        		return;
        	}
			if(remark1==null || remark1==""){
				new TipBox({type:'tip',str:'电话号码不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
				return;
			}
			if(remark2==null || remark2==""){
				new TipBox({type:'tip',str:'电子邮箱不能为空',clickDomCancel:true,setTime:1300,hasBtn:false});
				return;
			}
			
			$.ajax({
		        type: "POST",
		        url: "/moblie/saveFeedback",
		        data:{"userId":1,"content":content,"remark1":remark1,"remark2":remark2},
		        dataType: "json",
		        success: function(data){
		                if(data=='200'){
		                	new TipBox({type:'success',str:'操作成功',hasBtn:true});
		                	window.location.href=window.location.href;
		                }else if(data=='201'){
		                	
		                }else if(data=='202'){
		                	new TipBox({type:'error',str:'错误码-10003!',hasBtn:true});  
		                	window.location.href=window.location.href;
		                }     
		          }
		    });
        }
        </script>
    </body>
</html>
